package ss12.MobileColorIdentifier.speak;

import java.util.Locale;

import ss12.MobileColorIdentifier.R;
import ss12.MobileColorIdentifier.database.DataBase;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.widget.Toast;

/** Speak Android Activity 
 * 	Uses text to speech to speak the name of a color
 * */
public class SpeakAndroid {
	
	 public static TextToSpeech mTts=null;	//text to speech variable
	 public static String mColorToSpeak = "";	//store the color to be spoken
	
	 private Context ctxt=null;
	 
	 	/*
		 * Constructor for the SpeakAndroid class. 
		 * @param c Context
		 */
	 public SpeakAndroid(Context c)
	 {
		ctxt = c;		
		mTts = new TextToSpeech(ctxt,(OnInitListener)ctxt);
		
	}

	
	/*
	 * sets the spoken language as US English
	 * speaks the string
	 * @param color the human language name of the color to be spoken
	 */
	public void speakText(String color){
		//set the language to speak
		mTts.setLanguage(Locale.US);
		mTts.speak(color, TextToSpeech.QUEUE_ADD, null);
	}

}
